| Frame | Time | Anger | Contempt | Disgust | Fear | Joy | Sad | Surprise | Neutral | ID |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0.0000 | 0.0101 | 0.0218 | 0.0043 | 0.0541 | 0.5260 | 0.0959 | 0.0010 | 0.2868 | T001-001 |
| 1 | 0.0333 | 0.0101 | 0.0218 | 0.0043 | 0.0541 | 0.5260 | 0.0959 | 0.0010 | 0.2868 | T001-001 |
| 2 | 0.0667 | 0.0101 | 0.0218 | 0.0043 | 0.0541 | 0.5260 | 0.0959 | 0.0010 | 0.2868 | T001-001 |
| 3 | 0.1000 | 0.0080 | 0.0187 | 0.0032 | 0.0375 | 0.5353 | 0.1050 | 0.0011 | 0.2911 | T001-001 |
| 4 | 0.1333 | 0.0091 | 0.0380 | 0.0158 | 0.0036 | 0.6902 | 0.0177 | 0.0004 | 0.2252 | T001-001 |
| 5 | 0.1667 | 0.0104 | 0.0450 | 0.0139 | 0.0030 | 0.7157 | 0.0162 | 0.0003 | 0.1955 | T001-001 |
| Start | End | Event.Switch | Event.Type | Event | ID |
|---|---|---|---|---|---|
| 86.5 | 246.50 | 1 | 1 | Analytical Questions | T001-005 |
| 508.5 | 657.50 | 1 | 2 | Mathematical Questions | T001-005 |
| 107.5 | 269.25 | 1 | 3 | Emotional Questions | T001-006 |
| 521.0 | 674.75 | 1 | 3 | Emotional Questions | T001-006 |
| 81.0 | 240.00 | 1 | 4 | Texting | T001-007 |
| 510.0 | 671.00 | 1 | 4 | Texting | T001-007 |
Sample of Cleaned Data Showing an Event Transition
| Subject | Trial | Age | Gender | Frame | Time | Event.Switch | Event | Action | Anger | Contempt | Disgust | Fear | Joy | Sad | Surprise | Neutral | Texting |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T001 | 007 | Y | M | 2427 | 80.900 | 0 | No Event | 0 | 0.0909 | 0.0575 | 0.4205 | 3e-04 | 0.0011 | 0.1343 | 0 | 0.2954 | 0 |
| T001 | 007 | Y | M | 2428 | 80.933 | 0 | No Event | 0 | 0.0612 | 0.0397 | 0.4293 | 4e-04 | 0.0011 | 0.1630 | 0 | 0.3052 | 0 |
| T001 | 007 | Y | M | 2429 | 80.967 | 0 | No Event | 0 | 0.1034 | 0.0963 | 0.3186 | 2e-04 | 0.0013 | 0.0856 | 0 | 0.3946 | 0 |
| T001 | 007 | Y | M | 2430 | 81.000 | 1 | Texting | 4 | 0.0363 | 0.4976 | 0.0171 | 1e-04 | 0.0024 | 0.0069 | 0 | 0.4396 | 1 |
| T001 | 007 | Y | M | 2431 | 81.033 | 1 | Texting | 4 | 0.0059 | 0.7285 | 0.0027 | 4e-04 | 0.0068 | 0.0063 | 0 | 0.2493 | 1 |
| T001 | 007 | Y | M | 2432 | 81.067 | 1 | Texting | 4 | 0.0058 | 0.6890 | 0.0035 | 4e-04 | 0.0077 | 0.0068 | 0 | 0.2868 | 1 |
Reproducible Research
Takeaways
Differences in variation between the trials suggest that it may be possible to build a model capable of predicting a texting event
Subject specific plots are unique enough that a individual subjects variables may be needed in modeling
Baseline Trial: Trial 4 was used as a baseline trial because the conditions were identical to the Texting Trial (dense traffic with detour)
Model Proposal:
Feed-Forward Neural Networks
Neural Network Components
Step 1: Model is Initialized with Random Weights
Step 2: Calculate Hidden Weights and Output Node Prediction
Step 3: Update Weights Based on Error
Step 4: Repeat steps 2-3 to update node values
General Model Form
\[ \begin{align*} nnet(Texting = & \text{ } Subject + Age + Gender + Anger + Contempt \text{ } + \\ & \text{ } Digust + Fear + Joy + Sad + Surprise + Neutral)\\ \end{align*} \]
Modeling Strategy
Train the same general model on various slices of the data to see what works best
12 total training/testing data sets created from the combination of Data Processing and Data Split methods
Data Processing
Data Split
Statistical Software
R's nnet package for feed-forward neural networks
The Caret Package
Performance and Validation Testing
Model Search Parameters
############################################################
## Model 8: Training and Evaluation
## Set Cross Validation
fit.control = trainControl(method = "cv", number = 10)
## Create combination of model parameters to train on
search.grid = expand.grid(decay = c(0, .1, .2), size = c(1, 10, 25, 50))
## Limit the iterations and weights each model can run
maxIt = 100; maxWt = 15000
fit = train(Texting ~ . - Time, mdl.08.train, method = "nnet",
trControl = fit.control,
tuneGrid = search.grid,
MaxNWts = maxWt,
maxit = maxIt)
44503 samples, 12 predictors, 2 classes: '0', '1'
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 40053, 40053, 40052, 40052, 40052, 40052, ...
Resampling results across tuning parameters:
decay size Accuracy Kappa
0.0 1 0.6654826 0.3042036
0.0 10 0.7857674 0.5519017
0.0 25 0.8135183 0.6129461
0.0 50 0.8252473 0.6375013
0.1 1 0.6830330 0.3182011
0.1 10 0.8052265 0.5934557
0.1 25 0.8247982 0.6352580
0.1 50 0.8304383 0.6472351
0.2 1 0.6809197 0.3126288
0.2 10 0.8033167 0.5889500
0.2 25 0.8196748 0.6242315
0.2 50 0.8241692 0.6336216